﻿<UserControl x:Class="MvvmDialogBehaviorSample.LoginDialogView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
             xmlns:mvvmdialogbehavor="clr-namespace:MvvmDialogBehavior;assembly=MvvmDialogBehavior"
             mc:Ignorable="d" 
             d:DesignHeight="268" d:DesignWidth="363" Height="234" Width="333" > <!-- TODO -->
    <i:Interaction.Behaviors>
        <mvvmdialogbehavor:WindowStyleBehavior>
            <mvvmdialogbehavor:WindowStyleBehavior.Style>
                <Style TargetType="Window">
                    <Setter Property="SizeToContent" Value="WidthAndHeight" />
                    <Setter Property="WindowState" Value="{Binding Path=Content.WindowState, 
                        RelativeSource={RelativeSource Mode=Self}, Mode=TwoWay}"/>
                    <Setter Property="Title" Value="{Binding Path=Content.WindowTitle, 
                        RelativeSource={RelativeSource Mode=Self}}"/>
                </Style>
            </mvvmdialogbehavor:WindowStyleBehavior.Style>
        </mvvmdialogbehavor:WindowStyleBehavior>
    </i:Interaction.Behaviors>
    
    <Grid Background="Blue"> 
        <Label Content="LoginDialogView" Height="29" HorizontalAlignment="Left" Margin="12,21,0,0" Name="label1" VerticalAlignment="Top" />
        <Label Content="UserName" Height="29" HorizontalAlignment="Left" Margin="22,70,0,0" Name="label2" VerticalAlignment="Top" />
        <Label Content="Password" Height="29" HorizontalAlignment="Left" Margin="22,112,0,0" Name="label3" VerticalAlignment="Top" />
        <TextBox Text="{Binding UserName}" Height="24" HorizontalAlignment="Left" Margin="96,72,0,0" Name="textBox1" VerticalAlignment="Top" Width="120" />
        <TextBox Text="{Binding Password}" Height="24" HorizontalAlignment="Left" Margin="96,114,0,0" Name="textBox2" VerticalAlignment="Top" Width="120" />
        <Button Content="Login" Command="{Binding LoginCommand}" Margin="61,157,189,39" />
        <Button Content="Cancel" Command="{Binding CancelCommand}" Margin="167,157,83,39" />
    </Grid>
</UserControl>
